﻿@model ProductReviewOverviewModel
@using Nop.Web.Models.Catalog;
@{
    int ratingPercent = 0;
    if (Model.TotalReviews != 0)
    {
        ratingPercent = ((Model.RatingSum * 100) / Model.TotalReviews) / 5;
    }
}
    @if (Model.TotalReviews > 0)
    {
        /*CSS stars: http://www.thebroth.com/blog/119/css-rating-stars*/
        <div class="product-reviews-overview">

            @Html.Action("ProductPartialReviews")
            <div class="product-review-links">
                <a href="@Url.RouteUrl("ProductReviews", new { productId = Model.ProductId })">
                    @Model.TotalReviews
                    @T("Reviews.Overview.Reviews")
                </a>
            </div>
        </div>
    }
    else
    { 
        <span>There is no review for this product yet.</span>
    }
    @*@if (Model.AllowCustomerReviews)
    {
        if (Model.TotalReviews > 0)
        {
            <div class="product-has-reviews">
                <a href="@Url.RouteUrl("ProductReviews", new { productId = Model.ProductId })">@T("Reviews.Overview.AddNew")</a>
            </div>
        }
        else
        {
        <div class="product-no-reviews">
            <p>There are currently no reviews.
                <a class="first-reviewer" href="@Url.RouteUrl("ProductReviews", new { productId = Model.ProductId })">
                    @T("Reviews.Overview.First")
                </a>
            </p>
        </div>
        }
    }*@
